<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        async function getUser(){
            console.log('获取用户基础信息');
        const user = await new Promise((resolve,reject)=>{
                try{
                    setTimeout(()=>{
                        console.log('获取用户信息成功');
                        const user = {
                            name : 'cz',
                            age : 18,
                            scr : '男'
                        }
                        resolve(user)
                    })
                }catch(e){
                    reject(e.message)
                }
            })

            console.log('获取用户电话信息');
         const phone = await new Promise((resolve,reject)=>{
                try{
                    setTimeout(()=>{
                        console.log('获取用户电话成功');
                        const phoneNumber = {
                           number : 12121212121
                        }
                        resolve({...user,...phoneNumber})
                    })
                }catch(e){
                    reject(e.message)
                }
            })

            console.log('全部信息',phone);
        }

        getUser();
    </script>
</body>
</html>